﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SharedLib.WinFormMVCFramework
{
    /// <summary>
    /// Simple implementation of the IController interface, use unity framework to resolve view object
    /// </summary>
    public abstract class ControllerBase
    {
        IView _view;

        public IView View 
        {
            get
            {
                if (_view == null) _view = ResolveView();
                return _view;
            }
        }
 
        /// <summary>
        /// Use unity to resolve view
        /// </summary>
        /// <returns></returns>
        protected abstract IView ResolveView();
    }
}
